<template>
	<view class="order-craftsman-item">
		<view class="order-craftsman-info">
			<text>用户：张天师</text>
			<text>联系方式：15928390021</text>
		</view>
		<view class="order-craftsman-desc">
			<text>响应描述：</text>保障员工健康安全，努力满足当地生产需求，也把各国人民的心连接
		</view>
		<view class="order-craftsman-actions">
			<view class="order-craftsman-price">
				<text class="iconfont">✔</text>
				<text>响应价格</text>
				<text>￥598</text>
			</view>
			<view class="order-craftsman-btns">
				<view class="btn">按钮0</view>
				<view class="btn">按钮1</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: () => null
			},
		},
		data() {
			return {
				showSelectCraftsmanModel: false
			}
		},
		methods: {
			// 选择匠人
			selectCraftsman() {
				uni.showModal({ 
					content: "确认是否选择\r\n该匠人处理订单事项",
					complete: (result) => {
						console.log('---- placeAnOrder ----: ', result);
						if (result.confirm) {
							uni.$u.toast('订单提交，去支付')
						}
					}
				}) 
				// this.showSelectCraftsmanModel = true;
			},
			// 查看匠人详情
			lookCraftsmanDetail() {
				if (!this.item) {
					return;
				}
				uni.navigateTo({
					url: "/packageUniversal/craftsman/craftsman?id="+ this.item.id
				})
			},
			// 确认弹框逻辑处理
			selectCraftsmanModel(status) {
				if (status) {
					// 去支付
				}
				this.showSelectCraftsmanModel = false;
			}
		}
	}
</script>

<style lang="scss" scoped>
.order-craftsman-item{
	display: flex;
	flex-direction: column;
	padding: 24rpx 32rpx 20rpx 32rpx;
	border-radius: 12rpx;
	margin-bottom: 24rpx;
	border: 1px solid #d2d2d2;
	background-color: #ffffff;
}
.order-craftsman-info{
	display: flex;
	justify-content: space-between;
	font-size: 28rpx;
	margin-bottom: 20rpx;
	color: #666666;
	text:nth-of-type(1) {
		margin-right: 48rpx;
		color: #287EFF;
	}
}
.order-craftsman-desc{
	font-size: 28rpx;
	line-height: 32rpx;
	height:  64rpx;
	color:#666666;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	margin-bottom: 24rpx;
	text{
		color: #111111;
	}
}
.order-craftsman-actions{
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.order-craftsman-price{
	display: flex;
	align-items: center;
	.iconfont{
		font-size: 36rpx;
		color: #C1C1C1;
		margin-right: 12rpx;
	}
	text:nth-of-type(2){
		font-size: 28rpx;
		color: #333333;
		margin-right: 12rpx;
	}
	text:nth-of-type(3){
		font-size: 30rpx;
		color: #CD2828;
	}
}
.order-craftsman-btns{
	display: flex;
	.btn{
		display: flex;
		flex:1;
		align-items: center;
		justify-content: center;
		width: 128rpx;
		line-height: 36rpx;
		text-align: center;
		padding: 12rpx 24rpx;
		box-sizing: border-box;
		border-radius: 6rpx;
		white-space: nowrap;
		border: 2rpx solid #287EFF;
		color: #287EFF;
		font-size: 32rpx;
		&:nth-of-type(2) {
			margin-left: 20rpx;
			background-color:#287EFF;
			color: #ffffff;
		}
	}
}
.slot-content{
	font-size: 30rpx;
	font-weight: 500;
	text-align: center;
	line-height: 42rpx;
	color: #111111;
	text{
		color: #CD2828;
	}
}
</style>
